﻿<DemoPageSectionComponent Id="Utility-Button-Template" ShowSizeMode="true">
    <ChildContentWithParameters Context="Params">
        @*BeginHide*@
        <div>
        @*EndHide*@
        <DxButton RenderStyle="ButtonRenderStyle.Info"
                  Click="@Like"
                  IconCssClass="btn-icon-like"
                  SizeMode="Params.SizeMode"
                  Text="Like">
            @context
            <span class="ms-1">@likes</span>
        </DxButton>
        @*BeginHide*@
        </div>
        @*EndHide*@
    </ChildContentWithParameters>

    @code {
        int likes;

        void Like(MouseEventArgs args) {
            likes++;
        }
        protected override void OnInitialized() {
            likes = 1;
        }
    }
</DemoPageSectionComponent>
